import logging
from pricelist import *
logging.basicConfig(filename="Unittest.log")
logging.debug

header_keywords = ['code','qty']
logging.info()

def is_header(header_word):
    header_word = header_word.lower() 
    for header_key in header_keywords: 
        header_key = header_key.lower()
        if header_key == header_word: 
            return True
    return False

def get_pricelist_sheet(PriceList_wb):
    '''the last sheet in the workbook named STANDARD wins
    @param PriceList_wb: xlrd.Book object
    @return: xlrd.sheet object
    '''
    logging.debug("get_pricelist_sheet called")
    sheet_name = 'STANDARD'
    sheet_object = None
    for sheet in PriceList_wb.sheets():
        if sheet_name.lower() == sheet.name.lower():
            logging.debug("Comparing keyword %s to worksheet name: %s" 
                          % sheet_name, sheet.name)
            sheet_object = PriceList_wb.sheet_by_name(sheet_name)
    return sheet_object

